<?php defined('SYSPATH') OR die('No direct access allowed.');

class Channels_Playlists_Controller extends Master_Channel_Controller{

	public function detail($id){
		$view = new View("channel/channel_playlist");

		$this->set_title("สร้างสถานีเพลง");

		$channel_playlist = new Channels_Playlists_Model;

		//		$playlist_id = $channel_playlist->get_playList_By_channelID($id);
		//
		//		Kohana::log("debug",count($playlist_id));
		//		foreach ($playlist_id as $row){
		//			Kohana::log("debug","playlist_id: ". $row["playlist_id"]);
		//		}

		//get user id
		$auth = new Auth();
		$user_id = $auth->get_user()->id;

		$playlists = $channel_playlist->get_playlists_channel($id);

//		foreach ($playlists as $row) {
//			Kohana::log("debug",$row["title"]);
//		}

		//render view
		$this->template->content = $view;
		$view->playlists = $playlists;
		$this->template->render(TRUE);
	}

}